Skip to content

Implement fistpoint for smapi in tests #340

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

Implement fistpoint for smapi in tests #340

wants to merge 6 commits into from

Conversation

Nambrok
Copy link
Contributor

@Nambrok Nambrok commented Jul 10, 2025

This PR implement the usage of fistpoint for testing some errors in smapi.
A fistpoint is an action that you can enable in the smapi to for example add a sleep at some point or raise an exception.
For example:

        with FistPoint(vm.host, "blktap_activate_inject_failure"):
            try:
                vm.start()
                vm.shutdown(force=True)
            except Exception as e:
                logging.info(f"Expected failure {e}")

Activating the fistpoint blktap_activate_inject_failure mean that the VDI activation will fail.
This fistpoint always raise an exception but most fistpoint just add a sleep in the code.
Using the fixture exit_on_fistpoint make all fistpoint raise an exception instead by enabling a special fistpoint called fist_LVHDRT_exit.

Nambrok added 4 commits July 24, 2025 14:11
And a `exit_on_fistpoint` fixture to enable the behavior of exiting
instead of pausing 30 seconds at normal fistpoint

Signed-off-by: Damien Thenot <[email protected]>
Signed-off-by: Damien Thenot <[email protected]>
Signed-off-by: Damien Thenot <[email protected]>
Signed-off-by: Damien Thenot <[email protected]>
@Nambrok Nambrok force-pushed the dtt-fp branch 4 times, most recently from d6691fc to 578fffb Compare July 24, 2025 13:40
Signed-off-by: Damien Thenot <[email protected]>
lib/vdi.py:
Renamed `size` to `get_virtual_size`

tests/storage/ext/test_ext_sr.py:
Changed to use `vdi.get_virtual_size()`
Fix Exception type in `test_failing_resize`

tests/storage/lvm/test_lvm_sr.py:
Changed to use `vdi.get_virtual_size()`
Changed Exception handling to use `pytest.raises()`

Signed-off-by: Damien Thenot <[email protected]>
@Wescoeur Wescoeur requested review from glehmann and removed request for ydirson August 4, 2025 14:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants